package org.red_cross_service.domain.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.*;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import lombok.Data;
import lombok.experimental.Accessors;
import org.red_cross_service.common.anno.Query;

import java.util.Date;

@Entity
@Data
@TableName("rc_user")
@Accessors(chain =true)
public class UserEntity {
    @Id
    @TableId(value = "user_id", type = IdType.AUTO)
    @ExcelIgnore
    private Integer userId;

    @TableField("open_id")
    @ExcelIgnore
    private String openId;

    @TableField("avatar_url")
    @ExcelIgnore
    private String avatarUrl;

    @Query(type = Query.QueryType.LIKE)
    @ExcelProperty(index = 0,value = "姓名")
    @ColumnWidth(20)
    @TableField("nick_name")
    private String nickName;

    @Query(type = Query.QueryType.LIKE)
    @ColumnWidth(20)
    @ExcelProperty(index = 2,value = "手机号")
    @TableField("phone")
    private String phone;

    @TableField(value = "create_at")
    @ExcelIgnore
    private Date createAt ;

    @TableField(value = "update_at")
    @ExcelIgnore
    private Date updateAt ;

    @Query(type = Query.QueryType.LIKE)
    @TableField("id_card")
    @ColumnWidth(20)
    @ExcelProperty(index = 1,value = "身份证")
    private String idCard;

    @Query(type = Query.QueryType.LIKE)

    @TableField("unit")
    @ColumnWidth(20)
    @ExcelProperty(index = 3,value = "单位")
    private String unit;
}